// generate-sitemap.js
import fs from 'fs'
const routes = ['/about', '/zhaopin', '/shop', '/product', '/scene', '/rentout', '/news', '/house', '/'] // Add your routes here
const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="https://www.kmdc.org.cn/schemas/sitemap/0.9">
  ${routes
    .map(
      (route) => `
  <url>
    <loc>https://www.kmdc.org.cn${route}</loc>
    <lastmod>${new Date().toISOString().split('T')[0]}</lastmod>
    <changefreq>weekly</changefreq>
    <priority>${route === '/' ? '1.0' : '0.8'}</priority>
  </url>`
    )
    .join('')}
</urlset>`

fs.writeFileSync('dist/sitemap.xml', sitemap)
